import React, { useCallback, useState } from 'react'
import Button from './Button'

export default function Memo() {
  let [count,setCount]=useState(0)
  // let [arr,setArr]=useState([1,2,3,4,5,6,7,8,9])
  let add =useCallback(()=>{
    setCount(v=>v+1)
  },[])
  // let addArr=()=>{}
  // console.log(add);
  return (
    <div >
    <h2>{count}</h2>
    <hr />
    <button onClick={()=>{

    }}>数组添加</button>
    <hr />
      <Button add={add}/>
    </div>
  )
}
